package com.niannian.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.niannian.BaseActivity;
import com.niannian.R;
import com.niannian.util.SpocketHelper;

/**
 * 关于
 * 
 * @author shenglin
 * 
 */
public class AboutActivity extends BaseActivity {
	TextView tv_version_info;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_about);
		initTopView();
		initView();
	}

	// 头部视图
	private ImageView iv_top_left, iv_top_right;
	private TextView top_title;
	private LinearLayout iv_top_left2, top_title2;

	private void initTopView() {
		iv_top_left = (ImageView) findViewById(R.id.iv_top_left);
		iv_top_left2 = (LinearLayout) findViewById(R.id.iv_top_left2);
		iv_top_left.setVisibility(View.VISIBLE);
		iv_top_left2.setVisibility(View.GONE);

		top_title = (TextView) findViewById(R.id.top_title);
		top_title2 = (LinearLayout) findViewById(R.id.top_title2);
		top_title.setVisibility(View.VISIBLE);
		top_title2.setVisibility(View.GONE);
		top_title.setText("关于");

		iv_top_right = (ImageView) findViewById(R.id.iv_top_right);
		iv_top_right.setVisibility(View.GONE);

		iv_top_left.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				// Intent i =
				// getBaseContext().getPackageManager().getLaunchIntentForPackage(getBaseContext().getPackageName());
				// i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				// startActivity(i);
				myfinish();
			}
		});
	}

	private void initView() {

		tv_version_info = (TextView) findViewById(R.id.tv_version_info);
		tv_version_info.setText("咚咚   版本" + SpocketHelper.getPackageVersion(AboutActivity.this));

	}
}
